home *** CD-ROM | disk | FTP | other *** search
/ The Big Mouth 10 / Big_Mouth_The_10_1996_-_Side_B.d64 / minesweeper 64 (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  6KB  |  194 lines

  1. 0 rem ** minesweeper 64 **
  2. 1 rem ** updated by adam wade **
  3. 2 rem ** aka simba the king **
  4. 3 rem ** in 1996 ** mdz! **
  5. 5 rem"          "now bugger off - you cant look at        my proggy!(NULL)
  6. 6 poke 808,234:poke 657,128
  7. 10 poke 53280,5:poke 53281,11
  8. 15 print"[147][155]"tab(13)"minesweeper 64"
  9. 20 print"   adapted from the ibm windows game"
  10. 25 print"      do you want instructions ??? ";
  11. 30 get a$:if a$="n" then print a$:goto 100
  12. 35 if a$<>"y"then 30
  13. 39 :
  14. 40 rem ** instructions **
  15. 45 print a$:forh=1 to 1000:next:print"[147]     instructions for minefield 64"
  16. 50 print"in this game 10, 25, 40 or 50 mines are"
  17. 51 print"placed on a 10 x 18 grid"
  18. 52 print"you must guess grid positions where"
  19. 53 print"there are no mines. when you guess a"
  20. 54 print"position, a number in that square will  show how many mines are nearby."
  21. 55 print"  note: [146] you will only be told how many"
  22. 56 printtab(9)"mines are in horizontal or"tab(49)"vertically adjacent squares."
  23. 57 printtab(9)"you will not be told if there"tab(49)"are any mines in diagonally"
  24. 58 printtab(9)"adjacent squares."
  25. 59 print"if you guess a square that contains a"
  26. 60 print"mine, you will be shown where all the   mines are, then the game will end."
  27. 61 print"        press space to continue "
  28. 62 get a$:if a$<>chr$(32) then 62
  29. 65 print"[147]     instructions for minefield 64"
  30. 66 print"to guess a grid position, enter the"
  31. 67 print"coordinates of the square, separated by a comma."
  32. 68 print"when entering the coordinates, enter the"
  33. 69 print"[145]column number first, then the row."
  34. 70 print"if you do not enter the two coordinates"
  35. 71 print"together, it does not matter, however,"
  36. 72 print"you will have to wait while the screen"
  37. 73 print"is redrawn. the same will happen if the"
  38. 74 print"playing area gets scrolled off screen."
  39. 75 print"        press space to continue "
  40. 80 get a$:if a$<>chr$(32) then 80
  41. 99 :
  42. 100 rem ** initialisation **
  43. 105 a=rnd(-ti)
  44. 110 dim x(50),y(50),c(50),b(2023),n(2023),p$(11),p(11):a=1148
  45. 115 print"[147][155]"tab(13)"minesweeper 64"
  46. 120 print"choose your level of difficulty"
  47. 121 print" 1 - 10 mines"
  48. 122 print" 2 - 25 mines"
  49. 123 print" 3 - 40 mines"
  50. 124 print" 4 - 50 mines"
  51. 130 get a$:if a$="1" then d=10:goto 140
  52. 131 if a$="2" then d=25:goto 140
  53. 132 if a$="3" then d=40:goto 140
  54. 133 if a$="4" then d=50:goto 140
  55. 134 goto 130
  56. 140 print""tab(12)"* please wait *"
  57. 145 g=180-d:p(11)=0
  58. 150 fors=1 to d:print"[145]positioning mine"s
  59. 160 x(s)=int(rnd(0)*18)
  60. 165 y(s)=int(rnd(0)*10)
  61. 170 forr=1 to 50:if r=s then 180
  62. 175 if x(r)=x(s) and y(r)=y(s) then 160
  63. 180 nextr
  64. 185 c(s)=a+(80*y(s))+(x(s)*2):nexts
  65. 199 :
  66. 200 rem ** draw grid **
  67. 210 print"[147]    0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1"
  68. 215 print"                        0 1 2 3 4 5 6 7"
  69. 220 print"   [176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174]"
  70. 225 fort=0 to 9
  71. 230 print"[145]"t"[221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
  72. 235 if t=9 then 245
  73. 240 print"[145]   [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
  74. 245 next
  75. 250 print"[145]   [173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
  76. 255 if z<>0 then return
  77. 260 input"move ??      [157][157][157][157][157][157]";x,y
  78. 265 gosub 300
  79. 270 if f<>0 then 260
  80. 275 g=g-1:p(11)=p(11)+1:if g=0 then 500
  81. 280 goto 260
  82. 290 print"space already used"
  83. 295 fort=1 to 1000:next:print"                  ":f=1:return
  84. 299 :
  85. 300 rem ** check & poke locations **
  86. 305 f=0
  87. 310 if peek(1107)<>112 then gosub 400
  88. 315 if peek(a+(80*y)+(x*2))<>32 then goto 290
  89. 316 if x<0 or x>17 then f=1:return
  90. 317 if y<0 or y>9 then f=1:return
  91. 320 fors=1 to 50
  92. 325 if a+(80*y)+(x*2)=c(s) then 600
  93. 330 nexts
  94. 335 m=0:fors=1 to d
  95. 340 if a+(80*y)+(x*2)-2=c(s) then m=m+1
  96. 341 if a+(80*y)+(x*2)+2=c(s) then m=m+1
  97. 342 if a+(80*y)+(x*2)-80=c(s) then m=m+1
  98. 343 if a+(80*y)+(x*2)+80=c(s) then m=m+1
  99. 345 nexts
  100. 350 if m=0 then poke a+(80*y)+(x*2),48
  101. 351 if m=1 then poke a+(80*y)+(x*2),49
  102. 352 if m=2 then poke a+(80*y)+(x*2),50
  103. 353 if m=3 then poke a+(80*y)+(x*2),51
  104. 354 if m=4 then poke a+(80*y)+(x*2),52
  105. 355 b(a+(80*y)+(x*2))=a+(80*y)+(x*2):n(a+(80*y)+(x*2))=peek(a+(80*y)+(x*2))
  106. 360 return
  107. 399 :
  108. 400 rem ** re-poke screen **
  109. 405 z=5:gosub 210
  110. 410 z=0:fors=1024 to 2023:poke b(s),n(s):next
  111. 420 return
  112. 499 :
  113. 500 rem ** game complete **
  114. 505 print"        press space to continue "
  115. 510 get a$:if a$<>chr$(32) then 510
  116. 515 print"[147]"tab(13)"minesweeper 64"
  117. 520 print"well done you have completed the game!"
  118. 525 print"try again with a higher (or lower)"
  119. 530 print"amount of mines...if you dare..."
  120. 540 gosub 700
  121. 550 goto 650
  122. 599 :
  123. 600 rem ** game over **
  124. 605 poke c(s),170:fort=1 to d:poke c(t),170:next
  125. 610 print"        press space to continue "
  126. 615 get a$:if a$<>chr$(32) then 615
  127. 620 print"[147]"tab(13)"minesweeper 64"
  128. 625 print"you stepped on a mine!"
  129. 630 print"you have been scattered across the      minefield"
  130. 640 print""tab(14)" game over "
  131. 645 gosub 700
  132. 650 print"would you like to play again ??? ";
  133. 660 get a$:if a$="n" then print a$:goto 670
  134. 665 if a$<>"y" then 660
  135. 666 print a$:fors=1 to 50:c(s)=0:next
  136. 667 fors=1024 to 2023:b(s)=0:next:goto 115
  137. 670 print"thanks for playing minefield 64."
  138. 675 print"this update was made in 1996 by adam"
  139. 680 print"wade (aka  simba the king [146] ) for your   enjoyment!"
  140. 685 print""tab(10)" press space to end "
  141. 690 get a$:if a$<>chr$(32) then 690
  142. 695 close 15:load"the main menu/bm",8,1
  143. 699 :
  144. 700 rem ** highscores **
  145. 705 cr$=chr$(13)
  146. 710 print"        press space to continue "
  147. 715 get a$:if a$<>chr$(32) then 715
  148. 720 print"[147]"tab(11)" ** highscores ** ":print" pos.   name"tab(16)"score"
  149. 730 open 15,8,15
  150. 731 if d=10 then b$="minesweep 64  l1"
  151. 732 if d=25 then b$="minesweep 64  l2"
  152. 733 if d=40 then b$="minesweep 64  l3"
  153. 734 if d=50 then b$="minesweep 64  l4"
  154. 740 open 2,8,2,"0:"+b$+",s,r"
  155. 745 gosub 790
  156. 750 fore=1 to 10
  157. 755 input#2,p$(e),p(e)
  158. 760 gosub 790
  159. 765 next
  160. 770 close 2
  161. 775 fore=1 to 10:l$(e)=str$(p(e)):next
  162. 780 fore=1 to 10:printe;tab(5);p$(e);tab(20-len(l$(e)));p(e):next
  163. 785 goto 800
  164. 789 :
  165. 790 input#15,en,em$,et,es
  166. 795 if en>0 then print en,em$,et,es:stop
  167. 796 return
  168. 799 :
  169. 800 rem ** check scores **
  170. 805 print"your score was"p(11)
  171. 810 if p(11)<=p(10) then 900
  172. 815 print"you got a highscore! well done!"
  173. 820 input"please enter your name ";p$(11)
  174. 825 if len(p$(11))>10 then print"the maximum length is 10 characters":goto 820
  175. 830 fore=10 to 1 step -1
  176. 835 if p(e)=>p(e+1) then 850
  177. 840 if p(e)<p(e+1) then q=p(e):p(e)=p(e+1):p(e+1)=q
  178. 845 q$=p$(e):p$(e)=p$(e+1):p$(e+1)=q$
  179. 850 nexte
  180. 855 fore=1 to 10:l$(e)=str$(p(e)):next
  181. 860 print"[147]"tab(10)" the new highscores [146]":print" pos.   name"tab(16)"score"
  182. 865 fore=1 to 10:printe;tab(5);p$(e);tab(20-len(l$(e)));p(e):next
  183. 870 open 2,8,2,"@0:"+b$+",s,w"
  184. 875 gosub 790
  185. 880 fore=1 to 10
  186. 885 print#2,p$(e);cr$;p(e)
  187. 890 gosub 790
  188. 895 nexte
  189. 896 close 2:close 15:return
  190. 899 :
  191. 900 rem ** no highscore **
  192. 905 print"your score was not high enough to reach the highscores! bad luck"
  193. 910 close 15:return
  194.